<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>远程控制显示系统</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background: #000;
            overflow: hidden;
        }

        #mainContainer {
            width: 100vw;
            height: 100vh;
            position: relative;
        }

        #contentFrame {
            width: 100%;
            height: 100%;
            border: none;
            background: #fff;
        }

        #statusBar {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: rgba(0, 0, 0, 0.8);
            color: #fff;
            padding: 10px;
            font-size: 14px;
            z-index: 1000;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        #fullscreenBtn {
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: #fff;
            padding: 5px 10px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.3s ease;
            margin-left: 10px;
        }

        #fullscreenBtn:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.5);
        }

        #connectionStatus {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .status-indicator {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #ff4444;
        }

        .status-indicator.connected {
            background: #44ff44;
        }

        #loadingOverlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 999;
            color: #fff;
            font-size: 24px;
        }

        .hidden {
            display: none !important;
        }

        #errorDisplay {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(255, 0, 0, 0.9);
            color: #fff;
            padding: 20px;
            border-radius: 10px;
            z-index: 1001;
            max-width: 80%;
            text-align: center;
        }
    </style>
</head>
<body>
    <div id="mainContainer">
        <div id="statusBar">
            <div id="connectionStatus">
                <div class="status-indicator" id="mqttStatus"></div>
                <span id="statusText">正在连接MQTT...</span>
            </div>
            <div id="currentContent">等待指令...</div>
            <button id="fullscreenBtn" onclick="toggleFullscreen()">全屏</button>
        </div>

        <iframe id="contentFrame" src="about:blank"></iframe>

        <div id="loadingOverlay" class="hidden">
            <div>正在加载内容...</div>
        </div>

        <div id="errorDisplay" class="hidden">
            <div id="errorMessage"></div>
        </div>
    </div>

    <!-- MQTT.js CDN -->
    <script src="https://unpkg.com/mqtt/dist/mqtt.min.js"></script>
    
    <script src="js/config.js"></script>
    <script src="js/mqtt-controller.js"></script>
    <script src="js/content-manager.js"></script>
    <script src="js/main.js"></script>
</body>
</html> 